<?if($this->is_public == 0 && !$this->hasAccess($this->board_uid)): echo $this->action('denied', 'error'); else:?>

	<h1>Thread-Übersicht</h1>
	
	<p><a href="<?=$this->url(array('controller' => 'index'),'index', true)?>">Forum</a><?=$this->getRootline($this->board_uid)?></p>
	
	<?=$this->partial('threads/subboards.phtml', array('query' => $this->getSubBoards($this->board_uid), 'translate' => $this->translate))?>
	
	<?=$this->paginationControl($this->result, 'Sliding', 'pagination_control.phtml', array('route' => 'threads_p2', 'uid' => $this->board_uid))?>
	
	<?if($this->result_count > 0):?>
		<table summary="boards" class="table_threads"> 
		<tr>
			<th width="24px"></th>
			<th><?=$this->translate->_('topic_title')?></th>
			<th width="10%" class="center"><?=$this->translate->_('topic_replies')?></th>
			<th width="10%" class="center"><?=$this->translate->_('topic_hits')?></th>
			<th width="20%" class="center"><?=$this->translate->_('topic_last_posts')?></th>
		</tr>
		
		<?foreach($this->result AS $result):?>
		<tr>
			<td class="center middle"><?=$this->getThreadStatus($result['uid'])?></td>
			<td>
			
				<?if($result['moved_uid'] > 0):?>
					<span style="font-size:0.8em; font-weight:bold;"><?=$this->translate->_('topic_moved')?></span>
				<?endif;?>
				
				<a href="<?=$this->url(array('controller' => 'posts', 'uid' => $result['uid'], 'title' => $this->escape($this->CleanUrlTitle($result['title']))), 'threads', true);?>">
					<?=$this->escape($result['title'])?>
				</a>
				
				<?if($result['is_sticky'] == 1):?>
					<img src="<?=$this->baseUrl()?>/static/gfx/icons/note.png" />
				<?endif;?>
				
				<?if($result['is_closed'] == 1):?>
					<img src="<?=$this->baseUrl()?>/static/gfx/icons/lock.png" />
				<?endif;?>
				
				<?if($result['is_deleted'] == 1):?>
					<img src="<?=$this->baseUrl()?>/static/gfx/icons/exclamation.png" />
				<?endif;?>
				
				<?if($result['is_public'] == 0):?>
					<a href="<?=$this->url(array('controller' => 'threads', 'action' => 'setpublic', 'uid' => $result['uid']), 'default', true)?>">
						<img src="<?=$this->baseUrl()?>/static/gfx/icons/eye.png" />
					</a>
				<?endif;?>
				
				<br />
				<span class="thread_meta">
					<?=MHDEV_Sprintf($this->translate->_('topic_created'), array('%user' => $this->GetAuthor($result['user_uid']), '%date' => $this->datetime($result['create_date'], 'dd. MMMM yy', true)))?>
				</span>
			</td>
			<td class="center middle"><?=$result['count_replies']?></td>
			<td class="center middle"><?=$result['count_hits']?></td>
			<td class="center middle"><?=$this->GetLastPost($result['last_reply_date'], $result['last_reply_user_uid'], $result['uid'])?></td>
		</tr>
		<?endforeach;?>
		
		</table>
		
		<br />
		<?=$this->paginationControl($this->result, 'Sliding', 'pagination_control.phtml', array('route' => 'threads_p2', 'uid' => $this->board_uid))?>
	
	<?else:?>
	
		<p class="notice"><?=$this->translate->_('error_topics')?></p>
	
	<?endif;?>
	
	<p><a href="<?=$this->url(array('controller' => 'threads', 'action' => 'add', 'uid' => $this->board_uid), 'threads_add', true)?>"><?=$this->translate->_('topic_create')?></a></p>

<?endif;?>

<?=$this->partial('legend.phtml', array('translate' => $this->translate))?>